package com.im.controller;

import com.im.MDA;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;

import java.util.HashMap;
import java.util.Map;

@Controller
public class BaseController {
    public void putMDA(Model model){
        Map<String,String> map=new HashMap<String,String>();
        map.put("SWITCH_AES_ENCRIPT_DECRIPT", MDA.SWITCH_AES_ENCRIPT_DECRIPT);
        map.put("AES_IV",  MDA.AES_IV);
        model.addAttribute("mda",map);
    }

    public static Map<String, Object> buildAjaxResultMap(Object resultData, String msg,
        Integer code) {
        Map<String, Object> data = new HashMap<>();
        data.put("result", resultData);
        data.put("resultMsg", msg);
        data.put("resultCode", code);
        return data;
    }
}
